package edu.cqie.demo04;

import edu.cqie.demo02.UserService;
import edu.cqie.demo02.UserServiceImpl;

/**
 * Client
 *
 * @description: --
 * @Author XiaoZhou
 * @Date 2023/10/17 19:48
 */
public class Client {
    public static void main(String[] args) {
        //真实角色
        UserServiceImpl userService = new UserServiceImpl();
        //代理角色：不存在
        ProxyInvocationHandler pih = new ProxyInvocationHandler();
        pih.setTarget(userService);//设置要代理的对象
        //动态生成代理类
        UserService proxy = (UserService) pih.getProxy();
        proxy.delete();

    }
}
